<template>
	<view class="u-page">
		<view class="bg-box">
			<image class="bg-image" src="/static/download.png" mode=""></image>
		</view>
		<view class="functions-box">
			<view class="btn" @click="toDownload()">
				下载APP
			</view>
		</view>
		<view class="popup-box" v-show="show">
			<image class="quote" src="/static/quote.png" mode=""></image>
			<image class="_text" src="/static/_text.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:false,
				andHref: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/aea01640-ec4f-11ea-b997-9918a5dda011.apk', //安卓app下载地址
				iosHref: 'https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8', //苹果appStore链接
			}
		},
		onLoad() {
			
		},
		methods: {
			toDownload(){
				if(this.is_weixin()){
					this.show=true;
				}else{
					if (uni.getSystemInfoSync().platform == 'android') {
						window.location.href = this.andHref;
					} else {
						window.open(this.iosHref);
					}
				}
			},
			is_weixin() {
				var ua = navigator.userAgent.toLowerCase();
				if(ua.match(/MicroMessenger/i) == "micromessenger") {
				   return true;
				}else {
				   return false;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.popup-box{
		position: fixed;
		top: 0upx;
		left: 0upx;
		width: 750upx;
		height: 100vh;
		background-color: rgba($color: #000000, $alpha: 0.5);
		.quote{
			position: absolute;
			right: 100upx;
			top: 40upx;
			width: 62upx;
			height: 126upx;
		}
		._text{
			position: absolute;
			right: 40upx;
			top: 160upx;
			width: 394upx;
			height: 148upx;
		}
	}
.bg-box{
	width:750upx;
	height: 73vh;
	.bg-image{
		width: 100%;
		height: 100%;
	}
}
.functions-box{
	width: 750upx;
	height: 27vh;
	display: flex;
	justify-content: center;
	align-items: center;
	.btn{
		width: 414upx;
		height: 130upx;
		background-image: url(/static/btn.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #FFFFFF;
		font-size: 36upx;
	}
}
</style>
